<?php /* Smarty version Smarty-3.1.16, created on 2017-09-29 11:39:39
         compiled from "D:\WORK\DRF\\wap\theme\xth1\\tpls\login.tpl" */ ?>
<?php /*%%SmartyHeaderCode:9129599d314134c696-37628410%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '54194b6ead8d7919d3922350554d5813b5b59dc1' => 
    array (
      0 => 'D:\\WORK\\DRF\\\\wap\\theme\\xth1\\\\tpls\\login.tpl',
      1 => 1506325808,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '9129599d314134c696-37628410',
  'function' => 
  array (
  ),
  'version' => 'Smarty-3.1.16',
  'unifunc' => 'content_599d314137b952_54192195',
  'has_nocache_code' => false,
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_599d314137b952_54192195')) {function content_599d314137b952_54192195($_smarty_tpl) {?><!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
    <?php echo $_smarty_tpl->getSubTemplate ("comm_header.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>

</head>
<body ontouchstart>
<div class="container" id="container">
    <div class="page">
        <div class="reg-box">
            <!--登录-->
            <div class="page__hd text-center">
                <img src="/wap/theme/xth1/images/comm/logo.png" width="60%">
            </div>
            <div class="weui-cells weui-cells_form">
                <div class="weui-cell">
                    <div class="weui-cell__hd">
                        <i class="icon iconfont icon-phone-icon"></i>
                    </div>
                    <div class="weui-cell__bd">
                        <input class="weui-input" id="mobile" type="tel" placeholder="手机号">
                    </div>
                </div>
                <div class="weui-cell weui-cell_vcodes">
                    <div class="weui-cell__hd">
                        <i class="icon iconfont icon-code-icon"></i>
                    </div>
                    <div class="weui-cell__bd">
                        <input class="weui-input" id="mobileCode" type="number" placeholder="验证码">
                    </div>
                    <div class="weui-cell__ft">
                        <button class="weui-vcode-btn" id="codeBtn">获取验证码</button>
                    </div>
                </div>
                <div class="weui-cell weui-cell_vcode">
                    <div class="weui-cell__hd">
                        <i class="icon iconfont icon-code-icon"></i>
                    </div>
                    <div class="weui-cell__bd">
                        <input class="weui-input" id="yzmCode" placeholder="请填写动态验证码">
                    </div>
                    <div class="weui-cell__ft" id="yzmDiv">
                    </div>
                </div>
            </div>
            <div class="weui-btn-area">
                <a class="weui-btn weui-btn_default" href="javascript:void(0)" id="bindingBtn">确认绑定</a>
            </div>
            <!--登录 end-->
        </div>
    </div>
</div>
</div>

<div id="dialogs">
    <!--BEGIN codeDialog-->
    <div class="js_dialog" id="codeDialog" style="display: none;">
        <div class="weui-mask"></div>
        <div class="weui-dialog">
            <div class="weui-dialog__hd"><strong class="weui-dialog__title">出错了</strong></div>
            <div class="weui-dialog__bd">短信验证码错误，请重新输入</div>
            <div class="weui-dialog__ft">
                <a href="javascript:;" class="weui-dialog__btn weui-dialog__btn_default">知道了</a>
            </div>
        </div>
    </div>
    <!--END codeDialog-->
</div>

<?php echo $_smarty_tpl->getSubTemplate ("comm_js.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>


<script type="text/javascript">

    $(function(){
        //发送验证码弹窗
        $('#codeBtn').on('click', function(){
            var mobile = $('#mobile').val();
            E.ajax_post({
                url : "/wap/login.html?ajaxFlg=2",
                data : { mobile : mobile },
                call : function (o) {
                    E.wxAlert(o.message)
                }
            })
        });

        $('#bindingBtn').on('click', function(){
            var mobile = $('#mobile').val();
            var mobileCode = $('#mobileCode').val();
            var yzmCode = $('#yzmCode').val();
            if($.trim(mobile)==''){
                E.wxAlert('请输入手机号');
                return;
            }
            if(!E.isMobile(mobile)){
                E.wxAlert('请输入正确的手机号');
                return;
            }
            if($.trim(mobileCode)==''){
                E.wxAlert('请输入短信验证码');
                return;
            }
            if($.trim(yzmCode)==''){
                E.wxAlert('请输入动态验证码');
                return;
            }

            E.ajax_post({
                url : "/wap/login.html?ajaxFlg=1",
                data : {
                    mobile : mobile,
                    mobileCode: mobileCode,
                    yzmCode: yzmCode
                },
                call : 'callFun'
            })
        });

        //关闭dialogs
        $('#dialogs').on('click', '.weui-dialog__btn', function(){
            $(this).parents('.js_dialog').fadeOut(0);
        });

        //验证码
        createYzm();
    });

    function callFun( o ) {
        if(o.code == 200){
            E.wxAlert(o.message, function () { location.href = '/wap/order.html'; } , 1)
        }else{
            E.wxAlert(o.message)
        }
    }

    function createYzm(){
        var yzm_src="/core/yzm.html?subsite=wap&code="+Math.ceil(Math.random()*10000);
        var yzm_html="<img class='weui-vcode-img' onclick='createYzm()' src='"+yzm_src+"' />";
        $("#yzmDiv").html(yzm_html)
    }
</script>
</body>
</html>
<?php }} ?>
